package com.sundae.smarthomedemo.Activitys;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by daijiyuan on 2017/6/5.
 * 邮箱 948820549@qq.com
 *
 * @Sundae
 */

public class MyActivityManager {

    private static List<Activity> activityList = new ArrayList<>();

    public static void addActivity(Activity activity)
    {
        activityList.add(activity);
    }

    public static void removeActivity(Activity activity)
    {
        activityList.remove(activity);
    }

    public static void removeAllActivity()
    {
        for(Activity activity : activityList)
            if(activity != null) activity.finish();
        activityList.clear();
    }
}
